package com.taoge.mqttdemo1.boot;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("/mqtt")
public class MqttController {
    private MqttGateway mqttGateway;
    private MqttConfiguration mqttConfiguration;

    @GetMapping("/test1")
    void sender1Msg(){
        mqttGateway.sendToMqtt(mqttConfiguration.getTopic(),"逗你玩");
    }
}
